<html>
	<head>
		<meta charset="utf-8"/>
		<title>BViewer</title>
		<link rel="stylesheet" type="text/css" href="../style.css"/>
	</head>
	<body>
		<h1>BScene</h1>
		<p>Inherites from <a href="BWidget.html">BWidget</a></p>
		<h2>public</h2>
		<table id="public">
			<tr><td align="right"/><td><a href="#BViewer(BWidget*)">BViewer</a>(BWidget* parent = 0);</td></tr>
			<tr><td align="right"/><td><a href="#~BViewer()">~BViewer</a>();</td></tr>
			<tr><td align="right">void </td><td><a href="#setScene(BScene*)">setScene</a>(BScene* scene);</td></tr>
			<tr><td align="right">BScene* </td><td><a href="#scene()">scene</a>() const;</td></tr>
			<tr><td align="right">void </td><td><a href="#setCamera(BCamera*)">setCamera</a>(BCamera* camera);</td></tr>
			<tr><td align="right">BCamera* </td><td><a href="#camera()">camera</a>();</td></tr>
			<tr><td align="right">const BCamera* </td><td><a href="#camera()">camera</a>() const;</td></tr>
			<tr><td align="right">void </td><td><a href="#setHandler(BHandler*)">setHandler</a>(BHandler* handler);</td></tr>
			<tr><td align="right">BHandler* </td><td><a href="#handler()">handler</a>();</td></tr>
			<tr><td align="right">const BHandler* </td><td><a href="#handler()">handler</a>() const;</td></tr>
			<tr><td align="right">double </td><td><a href="#unit(double)">unit</a>(double dist) const;</td></tr>
			<tr><td align="right">double </td><td><a href="#unit(const BVector&)">unit</a>(const BVector& point) const;</td></tr>
			<tr><td align="right">BVector </td><td><a href="#vertex(int, int, double)">vertex</a>(int x, int y, double d) const;</td></tr>
			<tr><td align="right">BLine </td><td><a href="#line(int, int)">line</a>(int x, int y) const;</td></tr>
			<tr><td align="right">BVector </td><td><a href="#vertex(const BPoint&, double)">vertex</a>(const BPoint& point, double d) const;</td></tr>
			<tr><td align="right">BLine </td><td><a href="#line(const BPoint&)">line</a>(const BPoint& point) const;</td></tr>
			<tr><td align="right">const BPickItem* </td><td><a href="#pick(int, int)">pick</a>(int x, int y) const;</td></tr>
			<tr><td align="right">const BPickItem* </td><td><a href="#pick(const BPoint&)">pick</a>(const BPoint& point) const;</td></tr>
			<tr><td align="right">virtual BSize </td><td><a href="#sizeHint()">sizeHint</a>() const;</td></tr>
		</table>
		<h2>protected</h2>
		<table id="protected">
			<tr><td align="right">virtual void </td><td><a href="#event(const BEvent&)">event</a>(const BEvent& event);</td></tr>
			<tr><td align="right">virtual void </td><td><a href="#paintEvent(const BEvent&)">paintEvent</a>(const BEvent& event);</td></tr>
		</table>
		<div id="desc">
			<h2>Detailed Description : </h2>
			<p>BViewer is view of a scene. It holds one scene and one camera, it holds a handler maybe. It shows the camera by painting the camera's pixmap in client rect. If it has a handler, the handler will catch all event coming to control the camera.</p>
			<p>BViewer provides convenient methods to pick thing of scene using a BPicker inside.</p>
		</div>
		<h2 id="docs">Member Documentation</h2>
		<div id="BViewer(BWidget*)">
			<h3>BViewer(BWidget* parent = 0);</h3>
			<p>Constructs a viewer.</p>
		</div>
		<div id="~BViewer()">
			<h3>~BViewer();</h3>
			<p>Destroys a viewer.</p>
		</div>
		<div id="setScene(BScene*)">
			<h3>void setScene(BScene* scene);</h3>
			<p>Attachs a scene to this viewer, if you want it shows, you should attach a camera for this viewer, the camera does't have to be in the scene.</p>
		</div>
		<div id="scene()">
			<h3>BScene* scene() const;</h3>
			<p>Returns the scene attached of this viewer.</p>
		</div>
		<div id="setCamera(BCamera*)">
			<h3>void setCamera(BCamera* camera);</h3>
			<p>Attachs a camera to this viewer, make you the camera has right paraments.</p>
		</div>
		<div id="camera()">
			<h3>BCamera* camera();</h3>
			<p>Get the camera attached of this viewer.</p>
		</div>
		<div id="camera()">
			<h3>const BCamera* camera() const;</h3>
		</div>
		<div id="setHandler(BHandler*)">
			<h3>void setHandler(BHandler* handler);</h3>
			<p>Attachs a handler to this viewer, which will catch viewer's event to control the camera.</p>
		</div>
		<div id="handler()">
			<h3>BHandler* handler();</h3>
			<p>Get the handler attached of this viewer.</p>
		</div>
		<div id="handler()">
			<h3>const BHandler* handler() const;</h3>
		</div>
		<div id="unit(double)">
			<h3>double unit(double dist) const;</h3>
			<p>Get size per pixel at distance of dist.</p>
		</div>
		<div id="unit(const BVector&)">
			<h3>double unit(const BVector& point) const;</h3>
			<p>Get size per pixel at the point.</p>
		</div>
		<div id="vertex(int, int, double)">
			<h3>BVector vertex(int x, int y, double d) const;</h3>
			<p>Get the vertex of position where pos is (x, y) and distance from camera is d.</p>
		</div>
		<div id="line(int, int)">
			<h3>BLine line(int x, int y) const;</h3>
			<p>Get a line at viewer pos(x, y), the line begins from camera near face ends to far face.</p>
		</div>
		<div id="vertex(const BPoint&, double)">
			<h3>BVector vertex(const BPoint& point, double d) const;</h3>
			<p>Get vertex at viewer point with d distance from the camra.</p>
		</div>
		<div id="line(const BPoint&)">
			<h3>BLine line(const BPoint& point) const;</h3>
			<p>Get a line at viewer point.</p>
		</div>
		<div id="pick(int, int)">
			<h3>const BPickItem* pick(int x, int y) const;</h3>
			<p>Try to pick a item of scene by the line at viewer pos(x, y);</p>
		</div>
		<div id="pick(const BPoint&)">
			<h3>const BPickItem* pick(const BPoint& point) const;</h3>
			<p>Try to pick a item of scene by the line at viewer point.</p>
		</div>
		<div id="sizeHint()">
			<h3>virtual BSize sizeHint() const;</h3>
		</div>
		<div id="event(const BEvent&)">
			<h3 id="event(const BEvent&)">virtual void event(const BEvent& event);</h3>
			<p>Handler will catch all event here. When event type is Event_Update if the camera is dirty this viewer will be fresed. When event type is Event_Resize the camera's pixel size will be ajusted to size of client size.</p></div>
		<div id="paintEvent(const BEvent&)">
			<h3 id="paintEvent(const BEvent&)">virtual void paintEvent(const BEvent& event);</h3>
			<p>If the camera is dirty it's frame will be rendered and painted to client rect.</p>
		</div>
	</body>
</html>